package cn.iocoder.yudao.framework.region.enums;

import cn.iocoder.yudao.framework.business.basic.enums.EnumCodable;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  区域数据集枚举
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2025/02/28
 */
@Getter
@AllArgsConstructor
public enum CityDataSet implements EnumCodable {

    Default("default", "开源项目抓取整理", "https://gitee.com/xiangyuecn/AreaCity-JsSpider-StatsGov"),
    Adapay("adapay", "Adapay 省市编码（四位）", "https://cdn.cloudpnr.com/adapayresource/documents/Adapay%e7%9c%81%e5%b8%82%e7%bc%96%e7%a0%81%ef%bc%88%e5%9b%9b%e4%bd%8d%ef%bc%89.json"),
    ;

    private final String code;
    private final String name;
    private final String url;

    public static CityDataSet getByCode(String code) {
        for (CityDataSet type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return Default;
    }

}
